<template>
    <div class="adviserTeacherDetail-container">
        <h1 class="title">{{detail.title}}</h1>
    <div class="time">{{detail.createtime | dateFrom}}</div>
    <div class="content" v-html="detail.content"></div>
    </div>
  </template>
  <script>
  import utils from "@/utils/utils";
  export default {
    data() {
      return {
        detail: {}
      };
    },
    filters: {
    dateFrom(e) {
      if (!e) return '';
      return utils.dateFormat(e, 'cn');
    }
  },
    created() {
      this.id = this.$route.query.id;//作业id
      this.initAjaxMethod();
    },
    methods: {
      initAjaxMethod() {
        const toast = this.$toast.loading("加载中...");
        this.$http
          .post(this.$API.SET_PEROFFICE_ADVISERTEACHERDETAIL, { id: this.id })
          .then((res) => {
            toast.clear();
            if (res.code == 1) {
              this.detail=res.data || {};
            }
          });
      },
    }
  };
  </script>
  
  <style lang="less">
  .adviserTeacherDetail-container {
    .title{
        padding:0.2rem;
        font-size:0.28rem;
        font-weight: bold;
        text-align: center;
    }
    .time{
        text-align: right;
        padding:0 0.2rem;
        font-size:0.28rem;
        color:#888;
    }
    .content{
        font-size:0.28rem;
        line-height: 0.56rem;
        padding:0.4rem 0.2rem 0.2rem 0.4rem;
    }
  }
  </style>